home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 15
/
Aminet 15 - Nov 1996.iso
/
Aminet
/
mus
/
midi
/
tf102_de.lha
/
tracks&fieldsdemo
/
tracks&fields
/
source
/
Tracks&Fields_Commands.S
Wrap
Text File
|
1992-09-02
|
11KB
|
519 lines
*************************************************
* *
* *
* *
* *
* *
* *
* Default commands for Tracks&Fields 1.0 *
* *
* *
* *
* *
* *
* *
*************************************************
*************************************************
* Patch offsets *
*************************************************
p_volume EQU 0 ; B : Patchdata
p_channel EQU 1 ; B
p_length EQU 2 ; B
p_program EQU 3 ; B
p_sizeof EQU 4
px_user1 EQU 0 ; B : Patch extra data...
px_user2 EQU 1 ; B
px_user3 EQU 2 ; B
px_user4 EQU 3 ; B
px_user5 EQU 4 ; B
px_user6 EQU 5 ; B
px_user7 EQU 6 ; B
px_user8 EQU 7 ; B
px_user9 EQU 8 ; B
px_user10 EQU 9 ; B
px_user11 EQU 10 ; B
px_user12 EQU 11 ; B
px_panpot EQU 12 ; B
px_mainvolume EQU 13 ; B
px_user13 EQU 14 ; B
px_user14 EQU 15 ; B
px_user15 EQU 16 ; B
px_user16 EQU 17 ; B
px_sizeof EQU 18
*************************************************
* ChanxxTemp offsets *
*************************************************
n_pattdata EQU 0 ; B
n_midinote EQU 0 ; B
n_midipatch EQU 1 ; B
n_cmd1hi EQU 2 ; B
n_cmd1lo EQU 3 ; B
n_pattdata2 EQU 4 ; B
n_cmd2hi EQU 4 ; B
n_cmd2lo EQU 5 ; B
n_cmd3hi EQU 6 ; B
n_cmd3lo EQU 7 ; B
n_volume EQU 8 ; B
n_mute EQU 9 ; B
n_channel EQU 10 ; B
n_nr EQU 11 ; B
n_length EQU 12 ; B
n_note EQU 13 ; B
n_patch EQU 14 ; B
n_reserved1 EQU 15 ; B
n_reserved2 EQU 16 ; W
n_notedelay EQU 18 : B
n_sizeof EQU 24 ; <- length of ChanXTemp block
*************************************************
* Offsets to code and data *
*************************************************
mcmd_SendMIDI EQU 0*4 ; -> APTR to SendMIDI routine
mcmd_SetTempo EQU 1*4 ; -> APTR to SetTempo routine.
; Change tempo in mdat_tempo,
; call this routine then set mdat_update-
; tempoprop flag.
mdat_Chan1Temp EQU 2*4 ; -> APTR to BLOCK Chan1data (24 bytes)
mdat_Chan2Temp EQU 3*4 ; -> APTR to BLOCK Chan2data (24 bytes)
mdat_Chan3Temp EQU 4*4 ; -> APTR to BLOCK Chan3data (24 bytes)
mdat_Chan4Temp EQU 5*4 ; -> APTR to BLOCK Chan4data (24 bytes)
mdat_Chan5Temp EQU 6*4 ; -> APTR to BLOCK Chan5data (24 bytes)
mdat_Chan6Temp EQU 7*4 ; -> APTR to BLOCK Chan6data (24 bytes)
mdat_Chan7Temp EQU 8*4 ; -> APTR to BLOCK Chan7data (24 bytes)
mdat_Chan8Temp EQU 9*4 ; -> APTR to BLOCK Chan8data (24 bytes)
mdat_Chan9Temp EQU 10*4 ; -> APTR to BLOCK Chan9data (24 bytes)
mdat_Chan10Temp EQU 11*4 ; -> APTR to BLOCK Chan10data (24 bytes)
mdat_Chan11Temp EQU 12*4 ; -> APTR to BLOCK Chan11data (24 bytes)
mdat_Chan12Temp EQU 13*4 ; -> APTR to BLOCK Chan12data (24 bytes)
mdat_Chan13Temp EQU 14*4 ; -> APTR to BLOCK Chan13data (24 bytes)
mdat_Chan14Temp EQU 15*4 ; -> APTR to BLOCK Chan14data (24 bytes)
mdat_Chan15Temp EQU 16*4 ; -> APTR to BLOCK Chan15data (24 bytes)
mdat_Chan16Temp EQU 17*4 ; -> APTR to BLOCK Chan16data (24 bytes)
mdat_PatchPtr EQU 18*4 ; -> APTR to APTR PatchDataMemory !Read only!
mdat_PatchXPtr EQU 19*4 ; -> APTR to APTR to extra PatchDataMemory,
; mainvol, pan...
mdat_NumPatches EQU 20*4 ; -> APTR to LONG PatchCount !Read only!
mdat_Counter EQU 21*4 ; -> APTR to WORD Read only!
mdat_PattBreakPos EQU 22*4 ; -> APTR to WORD
mdat_PattBreakFlag EQU 23*4 ; -> APTR to BYTE
mdat_Tempo EQU 24*4 ; -> APTR to WORD
mdat_Speed EQU 25*4 ; -> APTR to WORD
mdat_PatternPos EQU 26*4 ; -> APTR to WORD
mdat_SongPos EQU 27*4 ; -> APTR to WORD
mdat_UpdateTempoProp EQU 28*4 ; -> APTR to BYTE, set this flag whenever
; tempo is changed...
mdat_CommandData EQU 29*4 ; -> APTR to User datablock (1024 bytes)
*************************************************
* Macros *
*************************************************
SAVEREGS MACRO
MOVEM.L D0-D7/A0-A6,-(SP)
ENDM
LOADREGS MACRO
MOVEM.L (SP)+,D0-D7/A0-A6
ENDM
SENDMIDI MACRO
SAVEREGS
MOVE.L mcmd_SendMIDI(A2),A0
JSR (A0)
LOADREGS
ENDM
SETTEMPO MACRO
SAVEREGS
MOVE.L mcmd_SetTempo(A2),A0
JSR (A0)
LOADREGS
ENDM
*************************************************
* *
* You recieve 6 registers with information: *
* *
* A2=ptr code and Data block *
* A3=ptr to Current Patch *
* A4=ptr to Current Patch extra data *
* A5=ptr to Current ChanTemp block *
* D0=Current command *
* D1=Command byte *
* *
* When you are finished with your command, *
* assemble with TRASH'M-One and write binary *
* like this: *
* *
* WB (PRESS ENTER and select the name) *
* Begin>Command (PRESS ENTER) *
* End>CommandEnd (PRESS ENTER) *
* *
*************************************************
*
* Your command should look like this...
*
* Command Dc.L "CMND" ;<-DON'T FORGET
* Dc.L CommandEnd-Commmand-8 ;<-DON'T FORGET
* Dc.B "name of the command " = 24 bytes ;<-DON'T FORGET
* SAVEREGS ;<-DON'T FORGET
*
* ;Place your code here
* ;Example:
* MOVE.B #$0F,D0 ;<-The MIDI byte in D0!
* SENDMIDI
*
* LOADREGS ;<-DON'T FORGET
* RTS ;<-DON'T FORGET
*CommandEnd
*
*************************************************
* Offsets for userdata buffer *
*************************************************
u_sizeof EQU 1024
*************************************************
* *
*************************************************
cmd_SetTempo Dc.L "CMND"
Dc.L cmd_SetTempoEnd-cmd_SetTempo-8
Dc.B "Set tempo "
SAVEREGS
MOVEQ #0,D0
MOVE.B D1,D0
CMP.B #32,D0
BHS stOk
MOVEQ #32,D0
stOk MOVE.L mdat_Tempo(A2),A0
MOVE.W D0,(A0)
MOVE.L mdat_UpdateTempoProp(A2),A0
ST (A0) ;<-Refresh tempo prop...
SETTEMPO
LOADREGS
RTS
cmd_SetTempoEnd
*************************************************
cmd_SetSpeed Dc.L "CMND"
Dc.L cmd_SetSpeedEnd-cmd_SetSpeed-8
Dc.B "Set speed "
SAVEREGS
MOVE.L mdat_Speed(A2),A0
MOVE.L mdat_Counter(A2),A1
MOVEQ #0,D0
MOVE.B D1,D0
MOVE.W D0,(A0)
MOVE.W D0,(A1)
LOADREGS
RTS
cmd_SetSpeedEnd
*************************************************
cmd_ChangeVelocity
Dc.L "CMND"
Dc.L cmd_ChangeVelocityEnd-cmd_ChangeVelocity-8
Dc.B "Change velocity "
SAVEREGS
MOVE.B D1,n_volume(A5)
LOADREGS
RTS
cmd_ChangeVelocityEnd
*************************************************
cmd_SetPanPot
Dc.L "CMND"
Dc.L cmd_SetPanPotEnd-cmd_SetPanPot-8
Dc.B "Set panpot "
SAVEREGS
MOVE.B n_channel(A5),D0
OR.B #$B0,D0
SENDMIDI
MOVE.B #$0A,D0
SENDMIDI
MOVE.B D1,D0
SENDMIDI
LOADREGS
RTS
cmd_SetPanPotEnd
*************************************************
cmd_SetLength
Dc.L "CMND"
Dc.L cmd_SetLengthEnd-cmd_SetLength-8
Dc.B "Set length "
SAVEREGS
TST.B D1
BEQ slSkip
MOVE.B D1,n_length(A5)
slSkip LOADREGS
RTS
cmd_SetLengthEnd
*************************************************
cmd_AfterTouch
Dc.L "CMND"
Dc.L cmd_AfterTouchEnd-cmd_AfterTouch-8
Dc.B "Aftertouch "
SAVEREGS
MOVE.B n_channel(A5),D0
OR.B #$D0,D0
SENDMIDI
MOVE.B D1,D0
SENDMIDI
LOADREGS
RTS
cmd_AfterTouchEnd
*************************************************
cmd_Breath
Dc.L "CMND"
Dc.L cmd_BreathEnd-cmd_Breath-8
Dc.B "Breath (JD-800) "
SAVEREGS
MOVE.B n_channel(A5),D0
OR.B #$B0,D0
SENDMIDI
MOVE.B #$02,D0
SENDMIDI
MOVE.B D1,D0
SENDMIDI
LOADREGS
RTS
cmd_BreathEnd
*************************************************
cmd_PitchBendUp
Dc.L "CMND"
Dc.L cmd_PitchBendUpEnd-cmd_PitchBendUp-8
Dc.B "Pitch up "
SAVEREGS
MOVE.B n_channel(A5),D0
OR.B #$E0,D0
SENDMIDI
MOVE.B #$00,D0
SENDMIDI
MOVE.B D1,D0
CMP.B #$3F,D0
BLS pbuOk
MOVEQ #$3F,D0
pbuOk ADD.B #$40,D0
SENDMIDI
LOADREGS
RTS
cmd_PitchBendUpEnd
*************************************************
cmd_PitchBendDown
Dc.L "CMND"
Dc.L cmd_PitchBendDownEnd-cmd_PitchBendDown-8
Dc.B "Pitch down "
SAVEREGS
MOVE.B n_channel(A5),D0
OR.B #$E0,D0
SENDMIDI
MOVE.B #$00,D0
SENDMIDI
MOVE.B #$40,D0
CMP.B D0,D1
BLS pbdOk
MOVE.B #$40,D1
pbdOk SUB.B D1,D0
SENDMIDI
LOADREGS
RTS
cmd_PitchBendDownEnd
*************************************************
cmd_Expression
Dc.L "CMND"
Dc.L cmd_ExpressionEnd-cmd_Expression-8
Dc.B "Expression (D10) "
SAVEREGS
MOVE.B n_channel(A5),D0
OR.B #$B0,D0
SENDMIDI
MOVE.B #$0B,D0
SENDMIDI
MOVE.B D1,D0
SENDMIDI
LOADREGS
RTS
cmd_ExpressionEnd
*************************************************
cmd_Modulation Dc.L "CMND"
Dc.L cmd_ModulationEnd-cmd_Modulation-8
Dc.B "Modulation "
SAVEREGS
MOVE.B n_channel(A5),D0
OR.B #$B0,D0
SENDMIDI
MOVE.B #$01,D0
SENDMIDI
MOVE.B D1,D0
SENDMIDI
LOADREGS
RTS
cmd_ModulationEnd
*************************************************
cmd_ProgramChange
Dc.L "CMND"
Dc.L cmd_ProgramChangeEnd-cmd_ProgramChange-8
Dc.B "Program change "
SAVEREGS
MOVE.B n_channel(A5),D0
OR.B #$C0,D0
SENDMIDI
MOVE.B D1,D0
SENDMIDI
LOADREGS
RTS
cmd_ProgramChangeEnd
*************************************************
cmd_MainVolume
Dc.L "CMND"
Dc.L cmd_MainVolumeEnd-cmd_MainVolume-8
Dc.B "Main volume "
SAVEREGS
MOVE.B n_channel(A5),D0
OR.B #$B0,D0
SENDMIDI
MOVE.B #$07,D0
SENDMIDI
MOVE.B D1,D0
SENDMIDI
LOADREGS
RTS
cmd_MainVolumeEnd
*************************************************
cmd_PatternBreak
Dc.L "CMND"
Dc.L cmd_PatternBreakEnd-cmd_PatternBreak-8
Dc.B "Pattern break "
SAVEREGS
MOVEQ #0,D0
MOVE.B D1,D0
CMP.B #$3F,D0
BLS pbOk
MOVE.W #$3F,D0
pbOk MOVE.L mdat_PattBreakPos(A2),A0
MOVE.W D0,(A0)
MOVE.L mdat_PattBreakFlag(A2),A0
ST (A0)
LOADREGS
RTS
cmd_PatternBreakEnd
*************************************************
cmd_ResetControllers
Dc.L "CMND"
Dc.L cmd_ResetControllersEnd-cmd_ResetControllers-8
Dc.B "Reset controllers "
SAVEREGS
MOVE.B D1,D0
BEQ rcNormal
SUB.B #1,D0
CMP.B #15,D0
BLS rcReset
MOVE.B #15,D0
BRA rcReset
rcNormal MOVE.B n_channel(A5),D0
rcReset OR.B #$B0,D0
SENDMIDI
MOVE.B #$79,D0
SENDMIDI
MOVE.B #$00,D0
SENDMIDI
LOADREGS
RTS
cmd_ResetControllersEnd
*************************************************
cmd_StopNote
Dc.L "CMND"
Dc.L cmd_StopNoteEnd-cmd_StopNote-8
Dc.B "Stop note "
SAVEREGS
CLR.B n_length(A5)
TST.B n_note(A5)
BEQ snSkip
MOVE.B n_channel(A5),D0
OR.B #$90,D0
SENDMIDI
MOVE.B n_note(A5),D0
SENDMIDI
MOVEQ #0,D0
SENDMIDI
CLR.B n_note(A5)
snSkip LOADREGS
RTS
cmd_StopNoteEnd
*************************************************
cmd_SetChannel Dc.L "CMND"
Dc.L cmd_SetChannelEnd-cmd_SetChannel-8
Dc.B "Set channel "
SAVEREGS
AND.B #$0F,D1
MOVE.B D1,n_channel(A5)
LOADREGS
RTS
cmd_SetChannelEnd
*************************************************
cmd_NoteDelay Dc.L "CMND"
Dc.L cmd_NoteDelayEnd-cmd_NoteDelay-8
Dc.B "Note delay "
SAVEREGS
MOVE.L mdat_Speed(A2),A0
MOVE.W (A0),D2
CMP.B D2,D1
BHI .Skip
MOVE.B D1,n_notedelay(A5)
.Skip LOADREGS
RTS
cmd_NoteDelayEnd
*************************************************